package org.sjs.dreamfly.biz.site

import androidx.lifecycle.ViewModelProvider
import android.os.Bundle
import org.sjs.dreamfly.browser.WebViewFragment

class SiteFragment : WebViewFragment() {

    companion object {
        fun newInstance(url: String) = SiteFragment().apply {
            this.arguments = Bundle().apply {
                putString("url", url)
            }
        }
    }

    private lateinit var viewModel: SiteViewModel

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        viewModel = ViewModelProvider(this)[SiteViewModel::class.java]
        arguments?.getString("url")?.let {
            loadUrl(it)
        }
    }
}